home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-08-14 | 19.7 KB | 299 lines | [TEXT/MPS ] |
-
- MC68020 Assembler - Ver 3.0 08-Mar-89 Page 1
- Copyright Apple Computer, Inc. 1984-1988
-
- Loc F Object Code Addr M Source Statement
-
- ;-------------------------------------------------------------------
- ;
- ;File: ExROM1Fun.a
- ;Dev system: MPW 3.0
- ;By: MacDTS
- ;Date: 3/8/89
- ;
- ; This is a very small sample declaration ROM with the required board
- ; sResource and a functional sResource (which is phony and blank at this time).
- ; The board id and functional sResource types are especially bogus - these values
- ; must be obtained from MacDTS, after sending in the required information.
- ; Anyway, this file is meant to show how to put together a ROM. Other references
- ; are the Cards and Drivers manual, with the source code for a ROM and driver
- ; (both are stripped down versions of the Apple Macintosh Video card ROM and
- ; video driver (aka the TFB board). There are also other examples and exploded
- ; drawings of other declaration ROMs up on AppleLink which you can download. To
- ; get to them, go into (in order):
- ;
- ; Developer Services icon
- ; Developer Technical Support folder
- ; Macintosh folder
- ; Tools folder
- ; Card Dev tools folder
- ;
- ;
- ;In the Card Dev tools folder, there are other folders containing tools and
- ;libraries. Those include:
- ;
- ;Examples folder - contains example declaration ROMs, video driver,
- ; source to a program like the GetsInfo program found
- ; in the Slot Tools folder
- ;Gamma Information folder - contains documention discussing gamma table format.
- ; This will be updated in later documentation for the
- ; new 32-bit QuickDraw. Contact Evangelism for
- ; information on this project. This folder won't be
- ; updated while seeding is going on, so the place to
- ; get it will be through Evangelism, and most likely,
- ; later on through APDA. Eventually, the Cards and
- ; Drivers book will contain the new gamma information,
- ; but that's a long time away...
- ;NuBusTester folder - contains a library to detect new ROMs with fixed
- ; slot manager (slot manger that runs in 32-bit mode
- ; as opposed to 24-bit mode)
- ;Training Tools folder - contains MacDraw drawings of exploded
- ; configuration ROMs (like the existing Apple video
- ; card ROM and the Apple EtherNet board ROM.
- ;
- ;Slot tools folder - Inside, you'll find these tools:
- ;
- ; CRCPatch - MPW tool that calculates and patches in
- ; the crc value of the assembled Declaration ROM file.
- ;
- ; Data - MPW tool takes the assembled file and strips off the code 0
- ; segment,leaving the code 1 segment (the raw code). The resulting
- ; file can then be downloaded to a rom burning machine.
- ;
- ; Tjscomm - A small terminal program that can be used to download the data
- ; file to a rom burning machine.
- ;
- ; SlotMgrTst - application that excersises the slot manager by making slot
- ; manager calls
- ;
- ; GetsInfo - application that displays sResources and other configuration ROM
- ; information
- ;
- ; Disclaimer: the above may be reorganized at any time, or changed via additions and deletions
- ;
- ;
- ; The general structure of this example ROM is:
- ;
- ; [Format/Header]
- ; |
- ; |
- ; [sResource Directory]
-
- MC68020 Assembler - Ver 3.0 08-Mar-89 Page 2
- Copyright Apple Computer, Inc. 1984-1988
-
- Loc F Object Code Addr M Source Statement
-
- ; / \
- ; / \
- ; / \
- ; / \
- ; [Board sResource] [Functional sResource]
- ; - Primary Init. - Driver Directory.
- ; - Vendor Info.
- ;
- ;
- ; If you want to print this, I suggest using landscape mode!!!
- ;
- ;-------------------------------------------------------------------
-
- MACHINE MC68020
-
- ;=====================================================================
- ; Initial Assembler Directives
- ;=====================================================================
- STRING C
- ;Note new names since C & D book!
- PRINT ON
-
- ;
- ;=====================================================================
- ; BEGIN Declaration ROM
- ;=====================================================================
- 00000 SampleDeclROM MAIN
- 00000
- 00000
- 00000
- 00000 ;*************************************************************
- 00000 ;Constants
- 00000 ;*************************************************************
- 00000
- 00000 0000 1000 ROMSize EQU $1000 ;4K byte ROM in this example
- 00000 0000 0000 TheBoardId EQU $0000 ;the Board Id (GOTTEN from DTS!)
- 00000
- 00000 ;board sResource equates
- 00000 ;The board sResource ALWAYS has sRsrc_Type of $0001 0000 0000 0000
- 00000 ;that is, <Category> = $0001 ALWAYS for board sResource
- 00000 ; <Type> = $0000 ALWAYS for board sResource
- 00000 ; <DrvrSW> = $0000 ALWAYS for board sResource
- 00000 ; <DrvrHW> = $0000 ALWAYS for board sResource
- 00000 ;catBoard EQU 1 ;commented out since already defined in ROMEqu.a
- 00000 ;TypeBoard EQU 0 ;commented out since already defined in ROMEqu.a
- 00000 0000 0000 DrvrSwBoard EQU 0 ;
- 00000 0000 0000 DrvrHwBoard EQU 0 ;
- 00000
- 00000 ;Functional sResource equates.
- 00000 ; DON'T USE THESE - GET VALUES FROM DTS. FOR EXAMPLE ONLY
- 00000 0000 6666 CatWhatCat EQU $6666 ;
- 00000 0000 7777 TypWhatType EQU $7777 ;
- 00000 0000 8888 DrSwWhatSWid EQU $8888 ;
- 00000 0000 9999 DrHwWhatHWid EQU $9999 ;
- 00000
- 00000 0000 0000 defMinorBase EQU 0 ;in this example, RAM Offset is 0
- 00000 0004 0000 defMinorLength EQU $40000 ;in this example, RAM length is $40000
- 00000
- 00000 ;----------- sResource Directory ;<Id OF>
- 00000 0000 0001 sRsrc_Board EQU 1 ;Board sResource {May be any number in [0..127]}
- 00000 0000 0080 sRsrc_Video EQU 128 ;Video sResource {May be any number in [128..254]}
- 00000
- 00000
- 00000 ;=====================================================================
- 00000 ; Directory
- 00000 ;=====================================================================
- 00000 _sRsrcDir OSLstEntry sRsrc_Board,_sRsrc_Board ;References the board sResource.
- 00000 0100 000C 1 DC.L (sRsrc_Board<<24)+_sRsrc_Board-*
- 00004 OSLstEntry sRsrc_Video,_sRsrc_Fun ;References the functional sResource. *** ASSIGNED BY
- 00004 8000 0088 1 DC.L (sRsrc_Video<<24)+_sRsrc_Fun-*
- 00008 DatLstEntry endOfList,0 ;End of the list.
- 00008 FF00 0000 1 DC.L (endOfList<<24)+0
- 0000C
- 0000C
-
- MC68020 Assembler - Ver 3.0 08-Mar-89 Page 3
- Copyright Apple Computer, Inc. 1984-1988
-
- Loc F Object Code Addr M Source Statement
-
- 0000C ;=============================================================
- 0000C ; sRsrc_Board List
- 0000C ;=============================================================
- 0000C _sRsrc_Board OSLstEntry sRsrcType,_BoardType ;References the sResource type (type always sam
- 0000C 0100 0018 1 DC.L (sRsrcType<<24)+_BoardType-*
- 00010 OSLstEntry sRsrcName,_BoardName ;References the sResource name.
- 00010 0200 001C 1 DC.L (sRsrcName<<24)+_BoardName-*
- 00014 DatLstEntry boardId,TheBoardId ;The board Id. *** ASSIGNED BY MACDTS ***
- 00014 2000 0000 1 DC.L (boardId<<24)+TheBoardId
- 00018 OSLstEntry primaryInit,_sPInitRec ;References the Primary init record.
- 00018 2200 0030 1 DC.L (primaryInit<<24)+_sPInitRec-*
- 0001C OSLstEntry vendorInfo,_VendorInfo ;References the Vendor information list.
- 0001C 2400 0030 1 DC.L (vendorInfo<<24)+_VendorInfo-*
- 00020 DatLstEntry endOfList,0 ;End of the list.
- 00020 FF00 0000 1 DC.L (endOfList<<24)+0
- 00024
- 00024 0001 _BoardType DC.W CatBoard ;<Category>
- 00026 0000 DC.W TypBoard ;<Type>
- 00028 0000 DC.W DrvrSwBoard ;<DrvrSw>
- 0002A 0000 DC.W DrvrHwBoard ;<DrvrHw>
- 0002C 4F464649434941 _BoardName DC.L 'OFFICIAL PRODUCT NAME HERE' ;The name of the Board - should be official pro
- 00048
- 00048
- 00048 ;-------------------------------------------------------------
- 00048 ; Primary Init Record (if needed)
- 00048 ;-------------------------------------------------------------
- 00048 0000 0004 _sPInitRec DC.L _EndsPInitRec-_sPInitRec ;The physical Block Size
- 0004C ;;; INCLUDE 'PrimaryInit.a' ;The Header/Code (See PrimaryInit.a)
- 0004C 0000 004C _EndsPInitRec EQU * ;End of block
- 0004C STRING C ;Restore to 'c' string type.
- 0004C
- 0004C
- 0004C ;-------------------------------------------------------------
- 0004C ; Vendor Info record
- 0004C ;-------------------------------------------------------------
- 0004C _VendorInfo OSLstEntry VendorId,_VendorId ;References the Vendor Id. *** VENDOR DEFINES TH
- 0004C 0100 0010 1 DC.L (VendorId<<24)+_VendorId-*
- 00050 OSLstEntry RevLevel,_RevLevel ;References the Revision Level. *** VENDOR DEFINES THIS,
- 00050 0300 0028 1 DC.L (RevLevel<<24)+_RevLevel-*
- 00054 OSLstEntry PartNum,_PartNum ;References the Part Number. *** VENDOR DEFINES THIS, NOT M
- 00054 0400 0030 1 DC.L (PartNum<<24)+_PartNum-*
- 00058 DatLstEntry endOfList,0 ;End of the list.
- 00058 FF00 0000 1 DC.L (endOfList<<24)+0
- 0005C
- 0005C 4D4F5354205055 _VendorId DC.L 'MOST PUT COMPANY NAME HERE' ;The Vendor Id
- 00078 426574612D3939 _RevLevel DC.L 'Beta-99.0' ;The Revision Level (whatever is desired)
- 00084 4142432D310000 _PartNum DC.L 'ABC-1' ;The Part Number (whatever is desired)
- 0008C
- 0008C
- 0008C ;=============================================================
- 0008C ; sRsrc_Video
- 0008C ;=============================================================
- 0008C _sRsrc_Fun OSLstEntry sRsrcType,_FunType ;References the functional sResource Type.
- 0008C 0100 001C 1 DC.L (sRsrcType<<24)+_FunType-*
- 00090 OSLstEntry sRsrcName,_FunName ;References the functional sResource Name.
- 00090 0200 0020 1 DC.L (sRsrcName<<24)+_FunName-*
- 00094 OSLstEntry sRsrcDrvrDir,_FunDrvrDir ;References the functional sResource driver directory
- 00094 0400 0048 1 DC.L (sRsrcDrvrDir<<24)+_FunDrvrDir-*
- 00098 DatLstEntry sRsrcHWDevId,1 ;The hardware device Id.
- 00098 0800 0001 1 DC.L (sRsrcHWDevId<<24)+1
- 0009C OSLstEntry MinorBaseOS,_MinorBase ;References the Minor Base Offset.
- 0009C 0A00 0038 1 DC.L (MinorBaseOS<<24)+_MinorBase-*
- 000A0 OSLstEntry MinorLength,_MinorLength ;References the Minor Base Length.
- 000A0 0B00 0038 1 DC.L (MinorLength<<24)+_MinorLength-*
- 000A4 DatLstEntry endOfList,0 ;End of the list.
- 000A4 FF00 0000 1 DC.L (endOfList<<24)+0
- 000A8
- 000A8 ;Functional sRsrc_Type labels, equates assigned by MacDTS
- 000A8 6666 _FunType DC.W CatWhatCat ;<Category>
- 000AA 7777 DC.W TypWhatType ;<Type>
- 000AC 8888 DC.W DrSwWhatSWid ;<DrvrSw>
- 000AE 9999 DC.W DrHwWhatHWid ;<DrvrHw>
- 000B0
- 000B0 57686174436174 _FunName DC.L 'WhatCat_WhatType_WhatSWid_WhatHWid' ;Convention: _FunName is derived by
-
- MC68020 Assembler - Ver 3.0 08-Mar-89 Page 4
- Copyright Apple Computer, Inc. 1984-1988
-
- Loc F Object Code Addr M Source Statement
-
- 000D4 ;using _FunName above, but stripping
- 000D4 ;off the Cat,Typ, and DrSw/Hw prefixes, then
- 000D4 ;separating by underscores
- 000D4
- 000D4 0000 0000 _MinorBase DC.L defMinorBase ;RAM Offset is 0 (for example!)
- 000D8 0004 0000 _MinorLength DC.L defMinorLength ;RAM length is $40000 (for example!)
- 000DC ;often this sort of thing is put in a dependant equates
- 000DC ;file (Apple puts video card dependent equates in the
- 000DC ;file DepVidEqu.a for example). I put them at the top
- 000DC ;of this file to put them in one file. Note the values
- 000DC ;used here are just for example purposes.
- 000DC
- 000DC
- 000DC ;-------------------------------------------------------------
- 000DC ; Driver directory (if on board driver)
- 000DC ;-------------------------------------------------------------
- 000DC _FunDrvrDir OSLstEntry sMacOS68020,_sMacOS68020 ;References the Macintosh-OS 68020 driver.
- 000DC 0200 0008 1 DC.L (sMacOS68020<<24)+_sMacOS68020-*
- 000E0 DatLstEntry endOfList,0 ;End of the list.
- 000E0 FF00 0000 1 DC.L (endOfList<<24)+0
- 000E4
- 000E4
- 000E4 ;Driver-1 (68020).
- 000E4 0000 0004 _sMacOS68020 DC.L _End020Drvr-_sMacOS68020 ;The physical Block Size
- 000E8 ;;; INCLUDE 'NameofDrvrSourceCodeFile.a' ;The Header/Code
- 000E8 0000 00E8 _End020Drvr EQU * ;The end of the driver.
- 000E8 STRING C
- 000E8
- 000E8
- 000E8
- 000E8
- 000E8 0000 0FEC ORG ROMSize-FHeaderRec.fhBlockSize
- 00FEC ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 00FEC ; Format/Header Block
- 00FEC ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 00FEC 00FF F014 DC.L (_sRsrcDir-*)**$00FFFFFF ;Offset to sResource directory
- 00FF0 0000 1000 DC.L ROMSize ;Length of declaration data
- 00FF4 0000 0000 DC.L 0 ;CRC {Patched by crcPatch (MPW tool)}
- 00FF8 01 DC.B romRevision ;Revision level
- 00FF9 01 DC.B AppleFormat ;Format
- 00FFA 5A93 2BC7 DC.L TestPattern ;Test pattern
- 00FFE 00 DC.B 0 ;Reserved byte (must be zero)
- 00FFF E1 DC.B $E1 ;ByteLanes: 1110 0001 (bytelane 0)
- 01000
- 01000
- 01000 ENDP
-
- END
-
- Elapsed time: 8.93 seconds.
-
- Assembly complete - no errors found. 3622 lines.
-